package aop.ano;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author wang fei
 * @date 2020-10-11 16:23
 */
@Component
@Aspect
@Order(1)   //优先级，值越小优先级越高。
public class PersonProxy {

    /**
     * 相同切入点抽取
     */
    @Pointcut(value = "execution(* aop.ano.User.add(..))")
    public void pointDemo(){

    }

    //前置增强
    @Before(value = "pointDemo()")
    public void before(){
        System.out.println("Person-before............");
    }
}
